home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / string.man < prev    next >
Encoding:
Text File  |  1991-06-03  |  6.0 KB  |  199 lines

  1.  
  2.  
  3.  
  4. STRING                C Library Procedures                 STRING
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      strcat, strncat, strcmp, strncmp, strcasecmp, strncasecmp,
  10.      strcpy, strncpy, strdup, strlen, strchr, index, strrchr,
  11.      rindex, strstr, strspn, strcspn, strpbrk - string operations
  12.  
  13. SSYYNNOOPPSSIISS
  14.      ##iinncclluuddee <<ssttrriinngg..hh>>
  15.  
  16.      cchhaarr **ssttrrccaatt((ss,, aappppeenndd))
  17.      cchhaarr **ss,, **aappppeenndd;;
  18.  
  19.      cchhaarr **ssttrrnnccaatt((ss,, aappppeenndd,, ccoouunntt))
  20.      cchhaarr **ss,, **aappppeenndd;;
  21.      iinntt ccoouunntt;;
  22.  
  23.      ssttrrccmmpp((ss11,, ss22))
  24.      cchhaarr **ss11,, **ss22;;
  25.  
  26.      ssttrrnnccmmpp((ss11,, ss22,, ccoouunntt))
  27.      cchhaarr **ss11,, **ss22;;
  28.      iinntt ccoouunntt;;
  29.  
  30.      ssttrrccaasseeccmmpp((ss11,, ss22))
  31.      cchhaarr **ss11,, **ss22;;
  32.  
  33.      ssttrrnnccaasseeccmmpp((ss11,, ss22,, ccoouunntt))
  34.      cchhaarr **ss11,, **ss22;;
  35.      iinntt ccoouunntt;;
  36.  
  37.      cchhaarr **ssttrrccppyy((ttoo,, ffrroomm))
  38.      cchhaarr **ttoo,, **ffrroomm;;
  39.  
  40.      cchhaarr **ssttrrnnccppyy((ttoo,, ffrroomm,, ccoouunntt))
  41.      cchhaarr **ttoo,, **ffrroomm;;
  42.      iinntt ccoouunntt;;
  43.  
  44.      cchhaarr **ssttrrdduupp((ss))
  45.      cchhaarr **ss;;
  46.  
  47.      ssttrrlleenn((ss))
  48.      cchhaarr **ss;;
  49.  
  50.      cchhaarr **ssttrrcchhrr((ss,, cc))
  51.      cchhaarr **ss;;
  52.      iinntt cc;;
  53.  
  54.      cchhaarr **iinnddeexx((ss,, cc))
  55.      cchhaarr **ss,, cc;;
  56.  
  57.      cchhaarr **ssttrrrrcchhrr((ss,, cc))
  58.      cchhaarr **ss;;
  59.      iinntt cc;;
  60.  
  61.  
  62.  
  63. Sprite v1.0              April 12, 1991                         1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. STRING                C Library Procedures                 STRING
  71.  
  72.  
  73.  
  74.      cchhaarr **rriinnddeexx((ss,, cc))
  75.      cchhaarr **ss,, cc;;
  76.  
  77.      cchhaarr **ssttrrssttrr((ss,, ss22))
  78.      cchhaarr **ss,, **ss22;;
  79.  
  80.      iinntt ssttrrssppnn((ss,, ss22))
  81.      cchhaarr **ss,, **ss22;;
  82.  
  83.      iinntt ssttrrccssppnn((ss,, ss22))
  84.      cchhaarr **ss,, **ss22;;
  85.  
  86.      cchhaarr **ssttrrppbbrrkk((ss,, ss22))
  87.      cchhaarr **ss,, **ss22;;
  88.  
  89. DDEESSCCRRIIPPTTIIOONN
  90.      These functions operate on null-terminated strings.  They do
  91.      not check for overflow of any receiving string.
  92.  
  93.      _S_t_r_c_a_t appends a copy of string _a_p_p_e_n_d to the end of string
  94.      _s. _S_t_r_n_c_a_t copies at most _c_o_u_n_t characters.  Both return a
  95.      pointer to the null-terminated result.
  96.  
  97.      _S_t_r_c_m_p compares its arguments and returns an integer greater
  98.      than, equal to, or less than 0, according as _s_1 is lexico-
  99.      graphically greater than, equal to, or less than _s_2.
  100.      _S_t_r_n_c_m_p makes the same comparison but looks at at most _c_o_u_n_t
  101.      characters.  _S_t_r_c_a_s_e_c_m_p and _s_t_r_n_c_a_s_e_c_m_p are identical in
  102.      function, but are case insensitive.  The returned lexico-
  103.      graphic difference reflects a conversion to lower-case.
  104.  
  105.      _S_t_r_c_p_y copies string _f_r_o_m to _t_o, stopping after the null
  106.      character has been moved.  _S_t_r_n_c_p_y copies exactly _c_o_u_n_t
  107.      characters, appending nulls if _f_r_o_m is less than _c_o_u_n_t char-
  108.      acters in length; the target may not be null-terminated if
  109.      the length of _f_r_o_m is _c_o_u_n_t or more.  Both return _t_o.
  110.  
  111.      _S_t_r_d_u_p allocates storage for a copy of _s, copies _s into it,
  112.      and returns the copied string.  The copy may be freed by
  113.      calling _f_r_e_e(3).
  114.  
  115.      _S_t_r_l_e_n returns the number of non-null characters in _s.
  116.  
  117.      _S_t_r_c_h_r and _i_n_d_e_x both return pointers to the first
  118.      occurrence of character _c in string _s or NNUULLLL if _c does not
  119.      occur in the string.  The two procedures are identical
  120.      except for their names and the argument _c, which is an iinntt
  121.      in _s_t_r_c_h_r and a cchhaarr in _i_n_d_e_x.  With the ANSI C standard,
  122.      _i_n_d_e_x is becoming obsolete.
  123.  
  124.      _S_t_r_r_c_h_r and _r_i_n_d_e_x are identical to _s_t_r_c_h_r and _i_n_d_e_x except
  125.      that the return the address of the last occurrence of _c
  126.  
  127.  
  128.  
  129. Sprite v1.0              April 12, 1991                         2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. STRING                C Library Procedures                 STRING
  137.  
  138.  
  139.  
  140.      instead of the first.  _R_i_n_d_e_x is also becoming obsolete.
  141.  
  142.      _S_t_r_s_t_r locates the first occurrence in the string pointed to
  143.      by _s of the sequence of characters (not including the ter-
  144.      minating null character) in the string pointed to by _s_2.  If
  145.      a match is found, the return value is the address of the
  146.      first character in the matching substring.  Otherwise, NNUULLLL
  147.      is returned.  If _s_2 points to a string with zero length,
  148.      then _s is returned.
  149.  
  150.      _S_t_r_s_p_n returns the length of the longest initial segment of
  151.      _s that consists entirely of characters from the string
  152.      pointed to by _s_2.  _S_t_r_c_s_p_n returns the length of the longest
  153.      initial segment of _s that consists entirely of characters
  154.      not in the string pointed to by _s_2.
  155.  
  156.      _S_t_r_p_b_r_k returns the address of the first character in the
  157.      string pointed to by _s of any character in the string
  158.      pointed to by _s_2.  If no character from _s_2 occurs in _s_1,
  159.      then NNUULLLL is returned.
  160.  
  161.  
  162. KKEEYYWWOORRDDSS
  163.      compare, copy, string
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sprite v1.0              April 12, 1991                         3
  196.  
  197.  
  198.  
  199.